import sys
sys.path.append('../')
from utils import *
import librosa
import pandas as pd
import json
f = open('Data/metadata.json')
metadata = json.load(f)
# view metadata present in the file
metadata
{'start_time': 1371,
'duration': 23,
'vocal_audio_path': 'Data/NIRP1_RamD_RagBah_Vox.wav',
'mix_audio_path': 'Data/NIRP1_RamD_RagBah_Stereomix.wav',
'tabla_audio_path': 'Data/NIRP1_RamD_RagBah_Tabla.wav',
'cycle_file': 'Data/NIRP1_RamD_RagBah_Teental.csv',
'num_div': 4}
playAudio(audioPath=metadata['mix_audio_path'], startTime=metadata['start_time'], duration=metadata['duration'])
%%capture
# initialise figure, with 3 subplots
fig, axs = generateFig(3, (14, 7), [2, 3, 3])
# plot waveplot
axs[0] = drawWave(audioPath=metadata['mix_audio_path'], startTime=metadata['start_time'], duration=metadata['duration'], ax=axs[0], annotate=False, cyclePath=metadata['cycle_file'], numDiv=metadata['num_div'], xlabel=False)
# plot spetogram 1
axs[1] = spectrogram(audioPath=metadata['vocal_audio_path'], startTime=metadata['start_time'], duration=metadata['duration'], cmap='Blues', ax=axs[1], yticks=True, annotate=True, cyclePath=metadata['cycle_file'], numDiv=metadata['num_div'], cAnnot='orange', annotLabel=False, title='Vocal Spectrogram', xlabel=False)
# plot spetogram 2
axs[2] = spectrogram(audioPath=metadata['tabla_audio_path'], startTime=metadata['start_time'], duration=metadata['duration'], cmap='Oranges', ax=axs[2], yticks=True, annotate=True, cyclePath=metadata['cycle_file'], numDiv=metadata['num_div'], cAnnot='purple', title='Tabla Spectrogram', xticks=True)
/Users/nithya/Projects/OSF/OSF-Visualisations/Fig4/../utils.py:353: FutureWarning: Pass sr=16000 as keyword args. From version 0.10 passing these as positional arguments will result in an error waveshow(audio, sr, ax=ax)
fig